/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.cinfo.siga.gestionacademica.datos.impl;

import org.apache.ibatis.session.SqlSession;
import org.cinfo.siga.gestionacademica.datos.base.Sesion;

/**
 *
 * @author lartkma
 */
class SesionImpl implements Sesion {
    
    private SqlSession sesion;

    public SesionImpl(SqlSession sesion) {
        this.sesion = sesion;
    }

    @Override
    public <T> T obtenerDAO(Class<T> clase) {
        return sesion.getMapper(clase);
    }

    @Override
    public void commit() {
        sesion.commit();
    }

    @Override
    public void rollback() {
        sesion.rollback();
    }

    @Override
    public void terminar() {
        sesion.close();
    }
    
}
